#ifndef	__CXX_VIEWS_WIDGET_BSCWIDGETS_H__
#define	__CXX_VIEWS_WIDGET_BSCWIDGETS_H__

#include "viswdgtbsc.h"
#include "vismgr/view.h"
#include "grph/canvas.h"

namespace viswidgets
{

class WIDGET_EXPORT_API widget_base
{
public:
	widget_base();
	~widget_base();
	operator view_t*() { return getview(); }

public:
	bool setshow(bool bshow);
	bool setpos(int left, int top, int width, int height);

public:

	/* show the widget */
	bool show(void) {
		return setshow(true);
	}

	/* hide the widget */
	bool hide(void) {
		return setshow(false);
	}

	/* get the view */
	view_t* getview(void) {
		return m_view;
	}

private:
	widget_base(const widget_base&);
	widget_base& operator =(const widget_base&);

protected:
	view_t *m_view;
};

enum widget_style
{
	widget_style_unknown = 0,
	widget_style_win31,
	widget_style_win10,
};

class WIDGET_EXPORT_API form : public widget_base
{
public:
	form(const form&);
	form(const visgrph::canvas&, widget_style style = widget_style_win31);
	form(view_t* parent = NULL, widget_style style = widget_style_win31);
	form(int left, int top, int width, int height,
		view_t* parent = NULL, widget_style style = widget_style_win31);
	virtual ~form();

	operator view_t*() const;

public:
	void canvas(const visgrph::canvas&);

public:
	void caption(const char* cap);

private:
	widget_style m_style;

private:
	form& operator =(const form&);
};

}; // namespace viswidgets
#endif	// __CXX_VIEWS_WIDGET_BSCWIDGETS_H__
/* EOF */

